<template>
  <div id="success">
           <van-nav-bar
          title="订单状态"
          :fixed=true
          :border=true
       ></van-nav-bar>
       <div class="h1"><div class="h2"><span style="margin-right:0.5rem"><van-icon name="checked" /></span><span>订单提交成功</span></div></div>
       <van-cell-group>
          <van-cell >
              <template #title>
                 <span style="margin-right:1rem">订单编号:</span><span>{{bianhao}}</span>
              </template> 
          </van-cell>
          <van-cell >
              <template #title>
                 <span style="margin-right:1rem">支付时间:</span><span style="color:rgb(170, 148, 148);font-size:0.8rem">{{payTime}}</span>
              </template> 
          </van-cell>  
        </van-cell-group>

       <van-cell-group style="margin-top:0.1rem">
            <van-button  style="margin-left:5rem" type="primary" url="http://localhost:8080/#/dashboard/mine">个人中心</van-button>
            <van-button style="margin-left:1.5rem"  type="primary" url="http://localhost:8080/#/dashboard/home">返回首页</van-button>
        </van-cell-group>
  </div>
</template>

<script>
import { Dialog } from 'vant'
import {mapState} from "vuex"
import { DatetimePicker, NoticeBar } from 'vant'

 import {getPayTime} from './../../../service/api/index'
	export default{
		name:"Success", 
		data(){
         return {
            bianhao:'',
            price:'' ,
            payTime:'',
            today:true
        }
		},
     mounted(){
         //  console.log(this.$route);
          this.bianhao = this.$route.params.bianhao;
          this.price = this.$route.params.price;
      //    console.log(this.price);
          // this.nowTime = '';
           var myDate = new Date();
         //  console.log(myDate.getHours());
           if (myDate.getHours>15) {
             this.today=false;
           };
     },
		 computed:{
    },
       created(){
          //  console.log(this.$route.params.bianhao);
             //获取用户信息
                getPayTime(this.$route.params.bianhao).then((response)=>{
                   console.log(response);
                  if (response.success) {
                      this.payTime = response.payTime;
                  }
                }).catch(error=>{
                    // todo......
                    console.log(error);
               })   //---catch
        }, // ----created
}
</script>

<style lang="less" scoped>
     #success{
      position:fixed;
      top:0;
      left:0;
      bottom:0;
      right:0;
      background-color:#f5f5f5;
      z-index:200;
      overflow-y: scroll;
     }


     .h1{
        margin-top:3rem;
        background: white;
        height:2.5rem;
     }
      
      .h2{
        color:#21d9a2;
        width: 8rem;
        height:1.5rem;
        margin-top: 3rem;
        margin-left:7rem;
        background-color:ehite;
      }

</style>